const mongodb = require("mongodb");

const { MongoClient, ObjectId } = require("mongodb");

exports.mongodb = () => {
  MongoClient.connect("mongodb://localhost:27017", (err, data) => {
    if (err) return console.log("link fail");
    console.log("link good");
    let db = data.db("koa");
    /* db.collection("user").updateOne(
      { name: "zs" },
      { $set: { name: "sq" } },
      (err, res) => {
        console.log(res);
      }
    ); */

    db.collection("user").deleteOne(
      { _id: ObjectId("612c39d24e414110f0693dab") },
      (err, res) => {
        console.log(res);
      }
    );
  });
};
